package com.yunhe.mapper;

import com.yunhe.javabean.Permission;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface PermissionMapper {
    //查询所有权限数据
    @Select("select * from permission")
    public List<Permission> selectAll();

    // 根据id查询权限数据
    @Select("select * from permission where id=#{id}")
    public Permission selectById(int id);

    // 根据id修改权限数据
    @Update("update permission set permissionName=#{permissionName},url=#{url} where id=#{id}")
    public int updateById(Permission permission);


    // 添加权限数据
    @Insert("insert into permission (permissionName,url) values(#{permissionName},#{url})")
    public int insert(Permission permission);

    // 根据id删除权限数据
    @Delete("delete from permission where id=#{id}")
    public int deleteById(int id);


    //根据用户id查询权限数据
    public List<Permission> selectByUid(int uid);




}
